package org.jsoup.nodes;

import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import o.gbk;
import o.gbq;
import o.gbt.b;
import o.gcb;
import o.gcd;
import o.gcj;

public class Document extends Element {
    private boolean ʻ = false;
    private d ʼ = d.noQuirks;
    private String ʽ;
    private e ˊ = new e();
    private gcb ˎ;

    public enum d {
        noQuirks,
        quirks,
        limitedQuirks
    }

    public static class e implements Cloneable {
        private a ʼ = a.html;
        private boolean ʽ = false;
        private Charset ˊ;
        private o.gbt.d ˋ = o.gbt.d.base;
        private boolean ˎ = true;
        private ThreadLocal<CharsetEncoder> ˏ = new ThreadLocal();
        public b ॱ;
        private int ᐝ = 1;

        public enum a {
            html,
            xml
        }

        public /* synthetic */ Object clone() throws CloneNotSupportedException {
            return ʽ();
        }

        public e() {
            ˏ(Charset.forName("UTF8"));
        }

        public o.gbt.d ˊ() {
            return this.ˋ;
        }

        public e ˏ(Charset charset) {
            this.ˊ = charset;
            return this;
        }

        public e ˋ(String str) {
            ˏ(Charset.forName(str));
            return this;
        }

        public CharsetEncoder ˋ() {
            CharsetEncoder newEncoder = this.ˊ.newEncoder();
            this.ˏ.set(newEncoder);
            this.ॱ = b.ˏ(newEncoder.charset().name());
            return newEncoder;
        }

        public CharsetEncoder ˏ() {
            CharsetEncoder charsetEncoder = (CharsetEncoder) this.ˏ.get();
            return charsetEncoder != null ? charsetEncoder : ˋ();
        }

        public a ˎ() {
            return this.ʼ;
        }

        public boolean ॱ() {
            return this.ˎ;
        }

        public boolean ʻ() {
            return this.ʽ;
        }

        public int ʼ() {
            return this.ᐝ;
        }

        public e ʽ() {
            try {
                e eVar = (e) super.clone();
                eVar.ˋ(this.ˊ.name());
                eVar.ˋ = o.gbt.d.valueOf(this.ˋ.name());
                return eVar;
            } catch (Throwable e) {
                throw new RuntimeException(e);
            }
        }
    }

    public /* synthetic */ Object clone() throws CloneNotSupportedException {
        return ˋ();
    }

    public /* synthetic */ gbq ʻ() {
        return ˋ();
    }

    public /* synthetic */ Element ʼ() {
        return ˋ();
    }

    public Document(String str) {
        super(gcj.ˋ("#root", gcd.ˋ), str);
        this.ʽ = str;
    }

    public String title() {
        Element ˋ = ˊ("title").ˋ();
        return ˋ != null ? gbk.ˎ(ˋ.ˊˋ()).trim() : "";
    }

    public String av_() {
        return super.ˊˊ();
    }

    public String ˎ() {
        return "#document";
    }

    public Document ˋ() {
        Document document = (Document) super.ʼ();
        document.ˊ = this.ˊ.ʽ();
        return document;
    }

    public e ॱॱ() {
        return this.ˊ;
    }

    public d ᐝ() {
        return this.ʼ;
    }

    public Document ˎ(d dVar) {
        this.ʼ = dVar;
        return this;
    }

    public gcb ʽ() {
        return this.ˎ;
    }

    public Document ॱ(gcb o_gcb) {
        this.ˎ = o_gcb;
        return this;
    }
}
